﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Datorgrafik_lab1.Models.Airplane;

namespace Datorgrafik_lab1.Objects.Airplane {
    public class Propeller : GameObject {

        private AirplanePropeller model;
        private float PropRot = 0f;

        public Propeller(GraphicsDevice graphics, Vector3 pos, float scale)
            : base(graphics, pos, Quaternion.Identity, scale)
        {
        }

        protected override void InitializeModel() {
            model = new AirplanePropeller();
            
            this.vertices = model.vertices;
            this.indices = model.indices;
        }

        public override void Update() {
            PropRot += 0.7f;

            this.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, PropRot);        
            
            base.Update();
        }

    }
}
